<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="com.gua.jbs.pojo.Jbspit"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/pages/common/header.jsp"%>
<html>
	<head>
		<script src="${jsContext}/jquery/jquery.dataTables.js" type="text/javascript"></script>
		<script src="${jsContext}/jquery/TableTools.js" type="text/javascript"></script>
		<script src="${jsContext}/jquery/ZeroClipboard.js" type="text/javascript"></script>
	
		<script type="text/javascript">		
			jQuery(document).ready(function() {
				jQuery('#allProdinfo').dataTable( {
					"bPaginate"      : true,
			        "sPaginationType": "full_numbers",// PaginationType:1.full_numbers 2. two_buttons
			        "aoColumns": [
						{ "sWidth":"6%"},
						{ "sWidth":"10%"},
						{ "sWidth":"10%"},
						{ "sWidth":"10%" },
						{ "sWidth":"15%"},
						{ "sWidth":"10%","iDataSort": 4},
						{ "sWidth":"15%","bSortable": false},
						{"bSortable": false }
					],
					/* "aaSorting": [[ 0, "desc" ]] , */
					/* sDom and oTableTools attribute --save data into csv,excel , pdf etc format */

					"sDom": 'T<"clear">lfrtip',

					"oTableTools": {
			            "sSwfPath": "/jewel/scripts/swf/copy_csv_xls_pdf.swf",
			            "aButtons": [
	                    	{
	                        	"sExtends": "collection",
	                            "sButtonText": "Download <span class='caret' />",
	                            "aButtons": [
                                	
                                    "pdf",
                                    {
                                    	"sExtends":"xls",
                                    	"sFileName": "*.xls"

                                    }
                                    
	                            ]
			            	},
			            ]
			        }

				});
			 });
		</script>
	</head>
	<body class="mainbody">
		<c:set var="productList" value="${requestScope.productList}"/>
		<div class="mainContainer">
			<section class="bodyContainer">
				<div class="productReport">
        			<h2 class="titleTxtBig">Product Report</h2>
            		<p class="hrlineBr"></p>

        			<div class="productDtls"> 
        				 <div class="divclear">
        				 	<form id="productDateWiseFilter" method="post" action="${context}/productFilter">
        				 		<input name="ACTION" value="FOD" type="hidden">
	                    		<span class="fromDateLable">Search Date From: </span>
	                    		<span class="fromDate">
	                           		<input class="datepicker datefld" name="FD" id="startDate" type="text" readOnly>
	                    		</span>
	                    		<span class="dateTo">To</span>
	                    		<span class="fromDate">
	                           		<input class="datepicker datefld" name="TD" id="endDate" type="text" readOnly>
	                    		</span>
	                    		<span class="searchBtn buttonSiyora"><a><input type="submit" onclick="return checkDate('startDate','endDate')" value="Search"/></a></span>
	                    	</form>
            			</div>
              
			            <p class="spacerTopTen"></p>
			            
         				<div class="divclear">
         					<table cellpadding="0" cellspacing="0" border="0" class="display reportTable" id="allProdinfo" style="width:961px">
								<thead>
									<tr>
										<th>Sr.No.</th>
										<th>Name</th>
										<th>HR Code</th>
										<th>Type</th>
										<th>Amount</th>
										<th>Date</th>
										<th>Print-Barcode</th>
										<th>Action</th>
									</tr>
								</thead>
								<tbody>
									<c:if test="${productList ne null}">
										<c:forEach var="product" items="${productList}" varStatus="counter">
											<tr>
											    <td><c:out value="${counter.count}"/></td>
												<td><c:out value="${product.prodName}"/></td>
												<td><c:out value="${product.hrCode}"/></td>
												<td><c:out value="${product.prodType}"/></td>
												<td><c:out value="${product.prodPrice}"/></td>
												<td><c:out value="${product.createDate}"/></td>
												<td>
													<a href="${context}/pages/jsp/newBarcode.jsp?prodId=${product.prodId}&prodName=${product.prodName}&hrCode=${product.hrCode}&prodCode=${product.prodCode}&designCode=${product.designCode}">${product.prodCode}</a>
												</td>
												<td>
													<a href="${context}/actionOnProduct?ACTION=InfoP&prodId=${product.prodId}">Details</a>
													<a href="${context}/actionOnProduct?ACTION=EP&prodId=${product.prodId}"><img src="${imageContext}/edit.gif"></a>
													<a onclick="return confirmation();" href="${context}/actionOnProduct?ACTION=DP&prodId=${product.prodId}"><img src="${imageContext}/delete.gif"></a>
												</td>
											</tr>
										</c:forEach>
									</c:if>
								</tbody>
							</table>
         				</div>
	         			<p class="spacerTopTen"></p>
		            	<p class="hrlineBr"></p>
		            	<p class="spacerTopTen"></p>
     				</div>           	        
				</div>
 			</section>
		</div>
		<jsp:include page="/pages/common/footer.jsp" />
	</body>
</html>